1. Field of the Invention
The present invention relates to a PWM (Pulse Width Modulation) circuit, and in particular to a PWM integrated circuit capable of receiving an external programming signal without any extra pin, and a PWM integrated circuit for use in such a PWM circuit.
2. Description of the Related Art
As shown in FIG. 1, a conventional PWM circuit comprises a comparator 10. An output voltage at the output terminal Vo is sampled by a voltage sampler circuit 20, and compensated by a compensation circuit 30; the output of the compensation circuit 30 is sent to an input terminal of the comparator 10, to be compared with a reference sawtooth wave and generate comparison output signals thereby, for controlling the operations of a control switch CTL_SW and a synchronous switch SYN_SW. The output voltage at the terminal Vo, after sampled by the voltage sampler circuit 20, is also fed back and compared with a reference voltage Vr, to more accurately control the positive input of the comparator 10. The operations of the switches CTL_SW and SYN_SW, through an inductor L, control the duty cycle (i.e., the pulse width) of an output square wave generated at the output terminal Vo. The output voltage may be used to support either or both of loads U_Load and L_Load (schematically shown for purpose of illustration only), according to circuit design requirements. The details of a PWM circuit are well known to one skilled in this art, and therefore are not further explained here.
In the above-mentioned circuit, the circuit elements encompassed by the dash line 100 are usually integrated in an integrated circuit, while the elements outside the dash line 100 are usually made from discrete devices. In the present invention, the complete circuit is referred to as “a PWM circuit”, while the partial circuit integrated into an integrated circuit is referred to as “a PWM integrated circuit”, which constitutes an essential part of a PWM circuit. The PWM integrated circuit 100 communicates with external circuit elements through pins. As shown in the figure, the integrated circuit 100 requires at least six pins P1-P6 to communicate with external circuit elements, including: a pin P1 electrically connecting with a voltage source Vs for supplying a relatively high voltage to the comparator 10; a pin P2 electrically connecting an output of the comparator 10 to the control switch CTL_SW for controlling its operation; a pin P3 receiving a voltage level from the node SW between the switches CTL_SW and SYN_SW, for supplying a reference voltage level to the comparator 10; a pin P4 electrically connecting another output of the comparator 10 to the synchronous switch SYN_SW for controlling its operation; a pin P5 for receiving the output from the compensation circuit 30; and a pin P6 for receiving the feedback signal from the voltage sampler circuit 20.
In addition to the above-mentioned pins, in a PWM circuit, it is usually required to avoid over current at the node SW, and therefore it is required to detect the current status at the node SW and provide a corresponding feedback control based thereon. There are two conventional ways to do so. As shown in FIG. 1, one conventional way is to provide a constant current source Ioc inside the PWM integrated circuit 100, and a resistor R1 outside the PWM integrated circuit. The resistance of the resistor R1 may be determined according to an over current threshold given by a user of the PWM circuit. By means of the constant current source Ioc and the resistor R1, a predetermined voltage is provided at the node Voc1. As shown in the figure, the predetermined voltage, after properly adjusted, is compared with the voltage level at the node SW by a comparator 40. (Thus, the so-called “over current threshold” is actually embodied in the form of a voltage comparison.) The comparison by the comparator 40 generates an output signal OCP which may be used to trigger over current protection, such as turning off certain switches.
Another conventional way is shown in FIG. 2. The integrated circuit 100 internally generates a reference voltage Voc2, which is input to a comparator 50. The voltage level at the node SW, minus a voltage drop by the resistor R2 (whose resistance may similarly be determined based on the over current threshold given by a user), is provided to another input terminal of the comparator 50. The comparison by the comparator 50 similarly generates an output signal OCP to trigger over current protection.
The above-mentioned conventional PWM circuits have a drawback that an additional pin P7 is required for over current protection, which is not desired. The pin number of an integrated circuit should be as few as possible.
Another drawback of the conventional PWM circuit is that, it is not possible to program the internal circuit inside the PWM integrated circuit unless an additional pin is provided.
In view of the foregoing drawbacks, the present invention proposes a PWM circuit and a PWM integrated circuit, which are capable of receiving an over current threshold setting, or other external programming signals, without any extra pin.